home *** CD-ROM | disk | FTP | other *** search
- unit BaseFormU;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- ExtCtrls, StdCtrls;
-
- type
- TBaseForm = class(TForm)
- Label1: TLabel;
- BtnOK: TButton;
- Timer1: TTimer;
- procedure Timer1Timer(Sender: TObject);
- procedure BtnOKClick(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- TBaseFormClass = class of TBaseForm;
-
- var
- BaseForm: TBaseForm;
- BaseFormClass: TBaseFormClass = TBaseForm;
-
- implementation
-
- {$R *.DFM}
-
- procedure TBaseForm.Timer1Timer(Sender: TObject);
- const
- Offset: Shortint = 5;
- Limit = 16;
- begin
- BtnOK.Left := BtnOK.Left + Offset;
- if BtnOK.Left + BtnOK.Width >= ClientWidth - Limit then
- begin
- Offset := Offset * -1;
- BtnOK.Left := ClientWidth - BtnOK.Width - Limit
- end
- else
- if BtnOK.Left <= Limit then
- begin
- Offset := Offset * -1;
- BtnOK.Left := Limit
- end
- end;
-
- procedure TBaseForm.BtnOKClick(Sender: TObject);
- begin
- Close
- end;
-
- end.
-